from Base import message, intersect, SS_VALID
from DRG import MDCB_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["01.2001","01.2002","01.2200","01.2900","02.9300x001","02.9301","02.9302","02.9303","02.9304","03.9300x003","03.9300x004","03.9302","03.9400x001","03.9400x002","04.9200x001","04.9200x002","04.9200x003","04.9202","04.9203","04.9300x001","04.9301","39.8101","39.8102","39.8201","39.8202","39.8301","39.8302","39.8400","39.8500","39.8600","39.8700","39.8800","86.0501","86.0900x009","86.9401","86.9402","86.9500x001","86.9500x002","86.9501","86.9502","86.9600x001","86.9600x002","86.9600x003","86.9600x006","86.9601","86.9602","86.9701","86.9702","86.9800x001","86.9800x002","86.9801","86.9802"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合BD2入组条件，匹配规则：主手术匹配')

    if MDCB_DRG.BD29_group(record):
      return 'BD29'
        
    return 'BD2'
  else:
    return ''
    
